#ifndef COMMUNICATE_H
#define COMMUNICATE_H

#include "main.h"
#include "data_fifo.h"
#include "protocol.h"
#include "task_lostcounter.h"
#include "driver_communicate.h"

#ifdef __cplusplus
extern "C" {
#endif
#include "bsp_usart.h"

#define UART_TX_SIGNAL      ( 1 << 2 )
#define UART_IDLE_SIGNAL    ( 1 << 1 )

extern osEventFlagsId_t refereeEventHandle;

/*********************************************************************************	
 * 					协议部分——公用协议
 *********************************************************************************/

#define DN_REG_ID    0xA5  //裁判系统通信
#define HEADER_LEN   5     //帧头长度为5个字节
#define CMD_LEN      2     //命令帧长度2个字节
#define CRC_LEN      2     //CRC16校验长度2个字节
#define INTERACTIVE_HEADER_LEN 6 //交互帧头

#define PROTOCOL_DATA_MAX_SIZE  128

extern receive_judge_t judge_rece_mesg;


#endif
